package com.coolwen.service;

;
import com.coolwen.dao.UserRoleMapper;
import com.coolwen.entity.Resource;
import com.coolwen.entity.User;
import com.coolwen.entity.UserRole;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by user on 2016/6/10.
 */
@Service("userRole")
public class UserRoleServiceImpl implements UserRoleService {

    @Autowired
    private UserRoleMapper urDao;
    @Override
    public int add(UserRole userRole) {
        return urDao.insertSelective(userRole);
    }

//    @Override
//    public void add(User user, List<Long> resIds) {
//
//    }

    @Override
    public int delete(long id) {
        return urDao.deleteById(id);
    }

    @Override
    public int update(UserRole userRole) {
        return urDao.updateById(userRole);
    }

    @Override
    public UserRole load(long id) {
        return urDao.selectById(id);
    }
}
